Skip to main content

Variable

The Variable class represents a workflow variable that can hold various types of data, including linked document values, and provides methods for manipulating and setting values from different sources, such as positions, professions, or documents.

Properties

NameDescription
LinkedObjectNameThe name of the object within the linked document that the variable corresponds to.
TextMLA dictionary representing multilingual text values for the variable, allowing for language-specific text retrieval.
KeyA unique identifier for the workflow step.
IsPublicSpecifies whether the variable is public, allowing access from other components or parts of the workflow.
WorkflowCodeInstanceThe workflow code instance associated with the flow object.
CachedDMObjectsThe cached document management objects related to the flow object.
LinkedDocumentObjectNameThe name of the linked document object that the variable is associated with, if any.
TypeCodeThe type code associated with the flow object.
ValueTypeThe data type of the variable's value, such as integer, decimal, text, or date.
IsLinkedIndicates whether the variable is linked to a document control, determining whether its value is sourced from a linked document object.
ValueSourceTypeThe source type of the variable's value, which determines where the value is retrieved from (e.g., document, position, profession).
NameName for the workflow step.
ValueThe value of the variable. It can be a simple data type or a complex object, depending on the variable's configuration and source.
TextThe text representation of the variable, used for displaying purposes, especially when the variable is linked to a document control.
IsHtmlIndicates whether the variable's value or text should be treated as HTML content.
CaptionThe caption dictionary representing localized captions for the flow object.

Constructors

NameDescription
Variable(name, workflowData, workflowCodeInstance)Constructor for the Variable class. Initializes a new instance of the Variable class.
Variable(name, workflowData, workflowCodeInstance)Constructor for the Variable class. Initializes a new instance of Variable with the specified name, workflow data, and optional workflow code instance.

Methods

NameDescription
SetFromPosition(sourcePosition)Sets the variable's value from a workflow position's ID and description.
SetFromDepartment(sourceDepartment)Sets the variable's value from a department's ID.
Increment()Increments the variable's value by 1, assuming the value is numeric.
Initialize()Initializes the variable. Can be used to set up default values or configurations for the variable before use.
SetFromProjectName()Sets the variable's value to the name of the current project in the workflow.
SetConstantValue(value)Sets the variable's value to a constant value, detaching it from any dynamic sources or links.
UnlinkObject()Removes the link between the variable and its associated document object, making it a regular variable with no document link.
ToLiquid()Converts the variable to a Liquid-compatible object, useful for rendering in templates or workflows.
SetFromVariable(sourceVariable, sourceProperty)Sets the variable's value from another variable, using either its value or text, depending on the property specified.
Decrement()Decrements the variable's value by 1, assuming the value is numeric.
SetFromProfession(sourceProfession)Sets the variable's value from a profession's ID.

Events

NameDescription
OnBeforeExecution(sender, args)Occurs before the execution of the workflow step.
OnAfterExecution(sender, args)Occurs after the execution of the workflow step.

Generic Types

NameDescription
TPropertiesGeneric type of properties.